<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
        年：<input type="text" id="year">
        月：<input type="text" id="month">
        日：<input type="text" id="day">
        <button id="btn">判断</button>
        <input type="text" id="result">
    <script>
        var yearInp = document.getElementById("year");
        var monthInp = document.getElementById("month");
        var dayInp = document.getElementById("day");
        var btn = document.getElementById("btn");
        var resultInp = document.getElementById("result");

        btn.onclick=function(){
        var year = yearInp.value * 1;
        var month = monthInp.value * 1;
        var day = dayInp.value * 1;

        resultInp.value=calc(year,month,day)
        }


        function calc(year,month,day){
              var count=0;
              var febDay=28;
              if((year % 4 == 0 && year % 100 != 0) || year % 400 == 0){
                  febDay=29;
              }
            switch(month){
                case 12:count += 30;
                        
                case 11:count += 31;
                
                case 10:count += 30;
                
                case 9:count += 31;
                
                case 8:count += 31;
                
                case 7:count += 30;
                
                case 6:count += 31;
                
                case 5:count += 30;
                
                case 4:count += 31;
                
                case 3:count += febDay;
                
                case 2:count += 31;
                
                case 1:count += day;
                break;
            }
            return count;
        }
    </script>
</body>
</html>